<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
	<script type="text/javascript">
		function callAddSeparator() {
			alert(document.TrayIconAppletImpl['addSeparator'])
			document.TrayIconAppletImpl.addSeparator()
		}
		
		function callShowTrayIcon() {
			alert(document.TrayIconAppletImpl['showTrayIcon'])
			document.TrayIconAppletImpl.showTrayIcon()
		}
		
		function callHideTrayIcon() {
			alert(document.TrayIconAppletImpl['hideTrayIcon'])
			document.TrayIconAppletImpl.hideTrayIcon()
		}

    	function callAddTextItem() {
			alert(document.TrayIconAppletImpl['addTextItem'])
			document.TrayIconAppletImpl.addTextItem('Test')
		}
		
		function call(elem, methodName, args) {
			var theFunc = elem[methodName];
			alert(theFunc);
			alert(methodName);
			alert(args);
			return theFunc(args);
		}
	</script>

    <title>Test Applet call</title>
  </head>

	<body>
		<div style="position:absolute; top:35px; left:240px; width:150px; height:60px;">
			<applet id="TrayIconAppletImpl" width="200" height="70" archive="GwtAI-Core.jar,GwtAI-Demo.jar" alt="Java Runtime Environment is not working on your system" name="TrayIconAppletImpl" code="com.google.gwt.gwtai.trayicon.impl.TrayIconAppletImpl.class" mayscript="true"></applet>
		</div>
		<div style="position:absolute; top:135px; left:240px; width:150px; height:150px;">
			<button onclick="callAddSeparator();">callAddSeparator</button>
			<button onclick="callShowTrayIcon();">showTrayIcon</button>
			<button onclick="callHideTrayIcon();">hideTrayIcon</button>
			<button onclick="call(document.TrayIconAppletImpl, 'addTextItem', 'Test2');">addTextItem</button>
		</div>
  </body>

</html>


